/* paint-colours.vala
 *
 * Copyright (C) 2010  Richard Talbot-Watkins
 * Copyright (C) 2010  Dave Jeffery
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Authors:
 *  Richard Talbot-Watkins <richtw1@gmail.com>
 * 	Dave Jeffery <david.richard.jeffery@gmail.com>
 */
 
/**
 * Paint Colours Data Model
 *
 * The class is responsible for storing the colours used for drawing and
 * erasing in the program. The colours are stored as BBC Micro MODE 5
 * logical colour indicies (0 - 3). The PaletteData class can convert
 * these values in to the colours actually displayed on the screen.
 *
 * @author Dave Jeffery <david.richard.jeffery@gmail.com>
 * @version 2010.1221
 * @since 0.1
 */
private class MonsterDesigner.PaintColours : GLib.Object {
	/**
	 * Signal emitted when data changed.
	 */
	public signal void changed ();

	/** 
	 * Current draw colour (when left button clicked).
	 *
	 * BBC logical colour index from 0 - 3, not the actual colour.
	 */
	private int _draw_colour = 3;

	/**
	 * Getter setter for the draw colour.
	 *
	 * Emits the changed signal if the colour has changed.
	 */
	public int draw_colour {
		get {
			return _draw_colour;
		}
		set {
			if (_draw_colour != value) {
				_draw_colour = value;
				changed ();
			}
		}
	}

	/**
	 * Current erase colour (when right button clicked).
	 *
	 * BBC logical colour index from 0 - 3, not the actual colour.
	 */
	private int _erase_colour = 0;

	/**
	 * Getter setter for the erase colour.
	 *
	 * Emits the changed signal if the colour has changed.
	 */
	public int erase_colour {
		get {
			return _erase_colour;
		}
		set {
			if (_erase_colour != value) {
				_erase_colour = value;
				changed ();
			}
		}
	}
}
